package service

import (
	sqlc "bgs/db/sqlc"
	"context"
)

// GetDistributorPtr
func (s *BrandServiceImp) GetDistributorPtr(ctx context.Context, q *sqlc.Queries, distributorID int64) (ptr *sqlc.BrandDistributor, err error) {
	entity, err := q.GetBrandDistributor(ctx, distributorID)
	if err != nil {
		return
	}
	ptr = &entity
	return
}

// GetDistributorPtrByUserIDAndBrandID
func (s *BrandServiceImp) GetDistributorPtrByUserIDAndBrandID(ctx context.Context, q *sqlc.Queries, userID, brandID int64) (ptr *sqlc.BrandDistributor, err error) {
	entity, err := q.GetBrandDistributorByUserIDAndBrandID(ctx, sqlc.GetBrandDistributorByUserIDAndBrandIDParams{
		UserID: userID,
		BrandID: brandID,
	})
	if err != nil {
		return
	}
	ptr = &entity
	return
}